home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-04-01 | 3.0 KB | 66 lines | [TEXT/R*ch] |
- WHY DOES ABC HAVE NO FILE HANDLING?
-
- One part of the philosophy of ABC is that the language should not
- reflect architectural details of computers. Consider Pascal: there are
- a number of features that are there because of features of computer
- architecture:
-
- that functions can only return 'small' values (because
- values are returned in registers);
- that there is such a thing as a maximum integer value;
- the existence of pointers.
-
- The same thing is true of C, and many other languages.
-
- Our opinion is that these architectural features only get in the way
- of the true task of programming: not being able to return a
- complicated structure is a pain; you want to count the number of times
- something happens: getting overflow doesn't help you achieve this.
-
- As a consequence we designed ABC from a 'task oriented' point of view:
- first try to work out what people are trying to achieve when
- programming, then design a language that supports that, and only
- *then* see if we could implement it. No maximum integers.
-
- Now, files reflect an architectural feature of computers: that there
- is two-level storage. If you want to keep a structure after your
- program has run you must convert the structure into a form acceptable
- for external storage (i.e. files), and write it out. Then the next
- time you run your program, you have to reread that file and recreate
- the internal structure. This has as little to do with true programming
- as checking for integer overflow does: it is purely administrative work.
-
- In ABC, the position is as follows: there is no two level storage.
- Your global variables do not disappear after you log out: when you
- start up again, there they are exactly as you left them.
-
- Put in another way: variables *are* files.
- Put in another way: there is no difference between files and variables.
-
- The advantages: one concept instead of two; much less to learn; the
- language doesn't need to have separate data-types and commands to
- manipulate files; the programmer's life is far easier; ABC's 'files'
- are much more powerful than traditional files (you have random access
- to elements, even associative access, for instance).
-
- On the other hand, we realise that in the 'real world' people have
- files that haven't been produced by ABC. Just in the same way that
- word-processors let you import ASCII files, or sometimes even files
- produced by another word processor, there is a facility to let you
- convert operating system files to ABC files. The facility is described
- in the helpfile: it is the -i option.
-
- For instance:
-
- abc -i autoexec < autoexec.bat
-
- will convert the MSDOS autexec.bat file to an ABC global called
- 'autoexec'. The global is created as a table of texts, one line to an
- entry.
-
- We have considered adding system programming additions to ABC to allow
- you to directly access non-ABC things from within ABC, but 1) we are
- afraid that people will then think that this is the file-handling
- feature of ABC, while in fact the true file-handling feature is far
- more powerful, and 2) we haven't had the time :-)
-